<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .stage {
            width: 864px;
        }
        .box {
            position: relative;
            width: 864px;
            height: 540px;
        }
        .box ul {
            height: 540px;
        }
        .box ul li {
            position: absolute;
            width: 216px;
            height: 540px;
            left: 0;
            transform-style: preserve-3d;
            transition: all 1s ease 0s;
        }
        .box ul li:nth-child(2) {
            transition-delay: 0.1s;
        }
        .box ul li:nth-child(3) {
            transition-delay: 0.2s;
        }
        .box ul li:nth-child(4) {
            transition-delay: 0.3s;
        }
        .box ul li:nth-child(1) div {
            background-position: 0 0;
        }
        .box ul li:nth-child(2) div {
            left: 216px;
            background-position: -216px 0;
        }
        .box ul li:nth-child(3) div {
            left: 432px;
            background-position: -432px 0;
        }
        .box ul li:nth-child(4) div {
            left: 648px;
            background-position: -648px 0;
        }
        .box ul li div {
            position: absolute;
            top: 0;
            left: 0;
            width: 216px;
            height: 540px;
            /* transform: translateZ(270px); */
            background-size: 864px 540px;
        }
        .box ul li div:nth-child(1) {
            transform: translateZ(270px);
            background-image: url(./img/1.jpeg);

        }
        .box ul li div:nth-child(2) {
            background-image: url(./img/2.jpeg);
            transform: rotateX(90deg) translateZ(270px);
        }
        .box ul li div:nth-child(3) {
            background-image: url(./img/3.jpeg);
            transform: rotateX(180deg) translateZ(270px);
        }
        .box ul li div:nth-child(4) {
            background-image: url(./img/4.jpeg);
            transform: rotateX(270deg) translateZ(270px);
        }
        .btn {
            display: block;
            width: 100px;
            height: 50px;
            margin: 0 auto;
            margin-top: 20px;
        }

    </style>
</head>
<body>
    <div class="stage">
        <div class="box">
            <ul>
                <li>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                </li>
                <li>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                </li>
                <li>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                </li>
                <li>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                </li>
            </ul>
        </div>
        <input type="button" name="" class="btn" value="下一张">
    </div>   
    
    <script src="./jquery-1.12.4.min.js"></script>
    <script>
        // 获取元素
        var $btn = $(".btn")
        var $lis = $(".box ul li")
        var sum = 0;
        var lock = false;
        // 点击事件
        $btn.click(function(){
            // 节流
            if (lock) return
            // 过河拆桥
            lock = true;
            // 变量自减向下旋转，自加向上旋转
            sum -=90;
            // 更改旋转角度，展示不同的div
            $lis.css({
                'transform':'rotateX('+ sum +'deg)'
            })
            // 延时器
            var time = (1+ 0.1*($lis.length-1))
            // console.log(time)
            setTimeout(function(){
                lock = false
            },time)

        })
    </script>
</body>
</html>